package main

import (
	"bufio"
	"fmt"
)

func main() {
	var a ByteCounter
	a.Write([]byte("1231"))
	fmt.Println(a)
	aa, b, c := bufio.ScanWords([]byte("asdfasf"), true)
	fmt.Println(aa, b, c)

	var aaa *ByteCounter
	aaaaa(aaa)
}

type ByteCounter int

func (c *ByteCounter) Write(p []byte) (int, error) {
	*c += ByteCounter(len(p)) // convert int to ByteCounter
	return len(p), nil
}
func aaaaa(aaa *ByteCounter) {
	if aaa != nil {
		fmt.Println("a")
	}
}
